<md-content layout-fill>
<div layout="column" layout-align="center"
     style="padding-left: 10%;padding-right: 10%;padding-bottom: 10%">
    <p style="font-size:x-large;padding-top: 30px;padding-bottom: 30px" align="center">— 问题详情 —</p>
    <!-- description of question-->
    <md-card layout="column"  class="md-whiteframe-4dp" >
            <md-card-title>
                <md-card-title-text>
                    <div layout="row">
                        <span class="md-headline"><span>Q:&nbsp;&nbsp;</span>{{essay.res.question.title}}</span>
                        <div flex></div>
                        <div layout-align="end end">
                            <span >- 来自@{{essay.res.userId}}的提问</span>
                        </div>
                    </div>
                    <div layout="row">
                        <span class="md-subhead" flex><i>{{essay.res.question.sum}}</i></span>
                        <span layout-margin>知识币：{{essay.res.reward}}</span>
                    </div>
                </md-card-title-text>
            </md-card-title>
            <md-card-content layout-align="end center">
                <P>{{essay.res.question.body}}</P>
                <br><md-divider></md-divider>
            </md-card-content>

            <div ng-if="essay.res.isAnswer">
                <md-card-title>
                    <md-card-title-text>
                        <div layout="row">
                            <span class="md-headline">A:&nbsp;&nbsp;</span>
                            <div flex></div>
                            <div layout-align="end end">
                                <span >- 来自@{{essay.res.consultantId}}的回答</span>
                            </div>
                        </div>
                    </md-card-title-text>
                </md-card-title>
                <md-card-content layout-align="end center">
                    <P>{{essay.res.answer.body}}</P>
                </md-card-content>
            </div>
            <div ng-if="!essay.res.isAnswer">
                <md-card-title>
                    <md-card-title-text>
                        <p style="font-size:large;word-spacing:30px;">该问题暂无回答</p>
                        <br>
                    </md-card-title-text>
                </md-card-title>
            </div>
        </md-card>
    <div style="padding-bottom: 10%" ng-if="isConsultant&&(!essay.res.isAnswer)">
        <form>
            <md-input-container class="md-block">
                <md-textarea-container  >
                    <textarea required ng-model="answer.body" type="text" rows="5" max-row="15" md-maxlength="500"
                              placeholder="请仔细阅读提问后，在下方输入您的回答">
                    </textarea>
                </md-textarea-container>
            </md-input-container>
            <div layout="row" layout-align="space-around center">
                <md-button ng-click="postAnswer(answer)" class="md-raised md-warn" type="submit"> 提交
                </md-button>
                <md-button ng-click="postAnswer(answer)" class="md-raised md-primary">保存</md-button>
            </div>
        </form>
    </div>
</div>
</md-content>

